//
//  WorksViewModel.swift
//  NDAi
//
//  Created by 丸子 on 2024/8/19.
//

import UIKit

class WorksViewModel {
    let reloadListSubject = PublishSubject<Void>()
    let errorSubject = PublishSubject<Void>()

    func releaseWorks(id:String, type:Int){
        NDProgressHUD.showLoading()
        RequestService.instance.releaseWorks(data_id: id, type: type) { [weak self] in
            NDProgressHUD.hide()
            self?.reloadListSubject.onNext(())
        } failureClosure: {[weak self] error in
            self?.errorSubject.onNext(())
            NDProgressHUD.showError(title: "", subtitle: error ?? "")
        }
    }
}
